<?php
require_once("main.php");
##########################################
function rssforum() {
##########################################
global $site,$feed;
include("includes/feedcreator.class.php");
$rss = new UniversalFeedCreator();
$rss->useCached();
$rss->title = "forum.froggies.dk";
$rss->description = "le forum de $site";
$rss->link = "http://$site/forum.php";
$rss->syndicationURL = "http://$site/".$PHP_SELF;

$image = new FeedImage();
$image->title = "$site logo";
$image->url = "http://$site/images/logo.gif";
$image->link = "http://$site";
$image->description = _DESCRIPTION;
$rss->image = $image;

// get your news items from somewhere, e.g. your database:

$res = mysql_query("SELECT titre,nom,texte,DATE_FORMAT(date_creation, '%Y-%m-%dT%H:%i:%S+02:00') AS date_creation FROM forum ORDER BY date_creation DESC");
while ($data = mysql_fetch_object($res)) {
    $item = new FeedItem();
    $item->title = $data->titre;
    $item->link = "http://$site";
    $item->description = $data->texte;
    $item->date = $data->date_creation;
    $item->source = $site;
    $item->author = $data->nom;

    $rss->addItem($item);
}

$rss->saveFeed($feed,"rss/$feed.xml");

}
##########################################
rssforum();

?>